// networkmanager.cpp
#include "networkmanager.h"

NetworkManager* NetworkManager::instance()
{
    static NetworkManager instance; // 单例实例
    return &instance;
}

NetworkManager::NetworkManager(QObject *parent) : QObject(parent)
{
    tcpSocket = new QTcpSocket(this);
    // 初始化socket，连接到服务器
    tcpSocket->connectToHost("127.0.0.1", 9090); // 替换为实际服务器地址和端口
}

QTcpSocket* NetworkManager::getSocket()
{
    return tcpSocket;
}

